package com.byt.framlib.basemvp.basebean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

public class ListPageBean<T> implements Parcelable {

    private List<T> list = new ArrayList<>();
    private int pageNum;
    private int pageSize;
    private int total;
    private int totalPage;

    protected ListPageBean(Parcel in) {
        pageNum = in.readInt();
        pageSize = in.readInt();
        total = in.readInt();
        totalPage = in.readInt();
    }

    public static final Creator<ListPageBean> CREATOR = new Creator<ListPageBean>() {
        @Override
        public ListPageBean createFromParcel(Parcel in) {
            return new ListPageBean(in);
        }

        @Override
        public ListPageBean[] newArray(int size) {
            return new ListPageBean[size];
        }
    };

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(pageNum);
        dest.writeInt(pageSize);
        dest.writeInt(total);
        dest.writeInt(totalPage);
    }
}